<template>
    <div id="app" class="container">
        <Button @click="selectAll">全选</Button>
        <Table ref="mainTable" :columns="columns" :data="tableDataStock" style="margin:15px" />
    </div>
</template>

<script>
import expandRow from './innerTable'
export default {
    name: "App",
    data() {
        return {
            columns: [
                {
                    type: "expand",
                    width: 50,
                    render: (h, params) => {
                        return h(expandRow, {
                            props: {
                                row: params.row
                            }
                        });
                    }
                },
                { title: "运单号", key: "billShow", minWidth: 120 }
            ],
            tableDataStock: [
                {billShow: 1},
                {billShow: 1},
                {billShow: 1},
            ]
        };
    },
    methods: {
        selectAll(){
            this.$refs['mainTable'].$children[1].$children.map(item => {
                if(item.$refs['awbhTable']){
                    item.$refs['awbhTable'].selectAll(true)
                }
            })
        }
    }
};
</script>